package com.jkl.untils;

import java.math.BigDecimal;

public class CommonUtil {
    /**
     * double类型保留小数
     * @param d
     * @param scale
     * @return
     */
    public static double doublePoint(double d,int scale) {
        BigDecimal bg = new BigDecimal(d);
        return bg.setScale(scale, BigDecimal.ROUND_HALF_UP).doubleValue();
    }
}
